package co.yixiang.service;

import co.yixiang.domain.KryConfig;
import co.yixiang.service.dto.OrderQueryCriteia;
import co.yixiang.service.dto.RefundApplyCriteia;
import co.yixiang.service.dto.ScanCodePay;

import java.security.NoSuchAlgorithmException;
import java.util.Map;

/**
 * @author frq
 * @date 2020-07-27
 */
public interface KryConfigService {

    /**
     * 查客如云配置
     *
     * @return QiniuConfig
     */
    KryConfig find();

    /**
     * 扫码支付(主扫获取二维码链接)
     *
     * @param scanCodePay 门店参数
     * @return
     */
    Map<String, Object> scanCode(ScanCodePay scanCodePay);

    /**
     * 查询支付结果
     * @param outTradeNo 支付单号
     * @return
     */
    Map<String, Object> payQuery(String  outTradeNo);

    /**
     * 订单列表查询
     *
     * @param criteia
     * @return
     */
    Map<String, Object> orderList(OrderQueryCriteia criteia);

    /**
     * 获取门店Token
     * @param kryConfig
     * @return
     */
    String getUrl(KryConfig kryConfig, String methods) throws NoSuchAlgorithmException;

    /**
     * 退款申请
     * @param criteia
     * @return
     */
    Map<String, Object> refundApply(RefundApplyCriteia criteia);

    /**
     * 退款状态查询
     * @param outRefundNo 调用方退款单号
     * @return outTradeNo 支付单号
     */
    Map<String, Object> refundQuery(String outRefundNo,String outTradeNo);
}